#include <iostream>
#include <vector>
#include <string>

using namespace std;

const int LEN = 8;

int n;
vector <long long> x, y, tr;
long long a, ax, ay;
string s;

int main()
{
	cin >> n >> s;

	tr.clear();
	tr.resize(LEN, 0);
	x = y = tr;

	for (int i = 0; i < LEN; i++)
		cin >> x[i];
	for (int i = 0; i < LEN; i++)
		cin >> y[i];

	cin >> a;

	for (int i = 0; i < n - 2; i++)
	{
		tr[(s[i] - 'a') * 4 + (s[i + 1] - 'a') * 2 + (s[i + 2] - 'a')]++;
	}

	ax = ay = 0;
	for (int i = 0; i < LEN; i++)
	{
		ax += (tr[i] - x[i]) * (tr[i] - x[i]);
		ay += (tr[i] - y[i]) * (tr[i] - y[i]);
	}

	if (ax > a && ay > a)
		cout << "Healthy\n";
	else if (ax > ay)
		cout << "Y\n";
	else
		cout << "X\n";

	cout << ax << ' ' << ay;

	return 0;
}